package com.exam.xiecheng;

import java.util.Scanner;

/**
 * date:
 * description:
 */
public class Solution002 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        int len = str.trim().length();
        long startWith0 = 0;
        for (int i = 0; i < len; i++) {
            if(i % 2 == 0 && str.charAt(i) != '0'){
                startWith0 += i + 1;
            }else if(i % 2 == 1 && str.charAt(i) != '1'){
                startWith0 += i + 1;
            }
        }
        long startWith1 = 0;
        for (int i = 0; i < len; i++) {
            if(i % 2 == 0 && str.charAt(i) != '1'){
                startWith1 += i + 1;
            }else if(i % 2 == 1 && str.charAt(i) != '0'){
                startWith1 += i + 1;
            }
        }
        if(startWith0 < startWith1){
            System.out.println(startWith0);
        }else{
            System.out.println(startWith1);
        }
    }
}
